package edu.zju.gis.dldsj.tasks;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author yanlong_lee@qq.com
 * @version 1.0 2018/10/26
 * @see edu.zju.gis.dldsj.config.ThreadPoolConfig
 */
@Component
public class MonitorTasks {
    /**
     * just for test
     */
    @Async
    public void print() {
        System.out.println(Thread.currentThread().getName());
    }

    @Async("taskExecutor")
    public void execute(Runnable runnable) {
        runnable.run();
    }
}
